package org.example.flatmap;

import com.alibaba.fastjson.JSONObject;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Java8FlatMap2 {
    public static void main(String[] args) {
        String[][] array = new String[][]{{"a", "b"}, {"c", "d"}, {"e", "f"}};

        // array to a stream
        Stream<String[]> stream1 = Arrays.stream(array);

        List<String[]> result = stream1.filter(x ->{
            for (String s : x) {
                if (s.equals("a")) {
                    return false;
                }
            }
            return true;
        }).collect(Collectors.toList());
        System.err.println(JSONObject.toJSONString(result));

        result.forEach(x -> System.err.println(Arrays.toString(x)));

    }
}
